<!DOCTYPE html>
<html lang="zh" class="no-js">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>14种CSS3炫酷表单input输入框美化效果_jQuery之家-自由分享jQuery、html5、css3的插件库</title>
		<link rel="stylesheet" type="text/css" href="css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.2.0/css/font-awesome.min.css" />
		<link rel="stylesheet" type="text/css" href="css/demo.css" />
		<link rel="stylesheet" type="text/css" href="css/component.css" />
		<!--[if IE]>
  		<script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
		<![endif]-->
	</head>
	<body>
		<div class="container">
			<header class="codrops-header">
				<h1>Text Input Effects <span>Simple ideas for enhancing text input interactions</span></h1>
				<p>更多精彩内容请关注：<a href="http://www.htmleaf.com/" target="_blank">jQuery之家</a></p>
			</header>
			<section class="content bgcolor-1">
				<h2 class="nomargin-bottom">Haruki</h2>
				<span class="input input--haruki">
					<input class="input__field input__field--haruki" type="text" id="input-1" />
					<label class="input__label input__label--haruki" for="input-1">
						<span class="input__label-content input__label-content--haruki">First Name</span>
					</label>
				</span>
				<span class="input input--haruki">
					<input class="input__field input__field--haruki" type="text" id="input-2" />
					<label class="input__label input__label--haruki" for="input-2">
						<span class="input__label-content input__label-content--haruki">Last Name</span>
					</label>
				</span>
				<span class="input input--haruki">
					<input class="input__field input__field--haruki" type="text" id="input-3" />
					<label class="input__label input__label--haruki" for="input-3">
						<span class="input__label-content input__label-content--haruki">Email</span>
					</label>
				</span>
			</section>
			<section class="content">
				<h2>Hoshi</h2>
				<span class="input input--hoshi">
					<input class="input__field input__field--hoshi" type="text" id="input-4" />
					<label class="input__label input__label--hoshi input__label--hoshi-color-1" for="input-4">
						<span class="input__label-content input__label-content--hoshi">Name</span>
					</label>
				</span>
				<span class="input input--hoshi">
					<input class="input__field input__field--hoshi" type="text" id="input-5" />
					<label class="input__label input__label--hoshi input__label--hoshi-color-2" for="input-5">
						<span class="input__label-content input__label-content--hoshi">Street</span>
					</label>
				</span>
				<span class="input input--hoshi">
					<input class="input__field input__field--hoshi" type="text" id="input-6" />
					<label class="input__label input__label--hoshi input__label--hoshi-color-3" for="input-6">
						<span class="input__label-content input__label-content--hoshi">Town</span>
					</label>
				</span>
				<p>Inspired by Andrej Radisic's <a href="https://dribbble.com/shots/1785176-Jawbreaker-input-field">Jawbreaker input field</a></p>
			</section>
			<section class="content bgcolor-4">
				<h2>Kuro</h2>
				<span class="input input--kuro">
					<input class="input__field input__field--kuro" type="text" id="input-7" />
					<label class="input__label input__label--kuro" for="input-7">
						<span class="input__label-content input__label-content--kuro">Username</span>
					</label>
				</span>
				<span class="input input--kuro">
					<input class="input__field input__field--kuro" type="text" id="input-8" />
					<label class="input__label input__label--kuro" for="input-8">
						<span class="input__label-content input__label-content--kuro">Website</span>
					</label>
				</span>
				<span class="input input--kuro">
					<input class="input__field input__field--kuro" type="text" id="input-9" />
					<label class="input__label input__label--kuro" for="input-9">
						<span class="input__label-content input__label-content--kuro">Invitation Code</span>
					</label>
				</span>
			</section>
			<section class="content bgcolor-7">
				<h2>Jiro</h2>
				<span class="input input--jiro">
					<input class="input__field input__field--jiro" type="text" id="input-10" />
					<label class="input__label input__label--jiro" for="input-10">
						<span class="input__label-content input__label-content--jiro">Cat's Name</span>
					</label>
				</span>
				<span class="input input--jiro">
					<input class="input__field input__field--jiro" type="text" id="input-11" />
					<label class="input__label input__label--jiro" for="input-11">
						<span class="input__label-content input__label-content--jiro">Dog's Name</span>
					</label>
				</span>
				<span class="input input--jiro">
					<input class="input__field input__field--jiro" type="text" id="input-12" />
					<label class="input__label input__label--jiro" for="input-12">
						<span class="input__label-content input__label-content--jiro">Hamster's Name</span>
					</label>
				</span>
			</section>
			<section class="content">
				<h2>Minoru</h2>
				<span class="input input--minoru">
					<input class="input__field input__field--minoru" type="text" id="input-13" />
					<label class="input__label input__label--minoru" for="input-13">
						<span class="input__label-content input__label-content--minoru">First Name</span>
					</label>
				</span>
				<span class="input input--minoru">
					<input class="input__field input__field--minoru" type="text" id="input-14" />
					<label class="input__label input__label--minoru" for="input-14">
						<span class="input__label-content input__label-content--minoru">Middle Name</span>
					</label>
				</span>
				<span class="input input--minoru">
					<input class="input__field input__field--minoru" type="text" id="input-15" />
					<label class="input__label input__label--minoru" for="input-15">
						<span class="input__label-content input__label-content--minoru">Last Name</span>
					</label>
				</span>
			</section>
			<section class="content bgcolor-5">
				<h2>Yoko</h2>
				<span class="input input--minoru">
					<input class="input__field input__field--yoko" type="text" id="input-16" />
					<label class="input__label input__label--yoko" for="input-16">
						<span class="input__label-content input__label-content--yoko">Street</span>
					</label>
				</span>
				<span class="input input--minoru">
					<input class="input__field input__field--yoko" type="text" id="input-17" />
					<label class="input__label input__label--yoko" for="input-17">
						<span class="input__label-content input__label-content--yoko">City</span>
					</label>
				</span>
				<span class="input input--minoru">
					<input class="input__field input__field--yoko" type="text" id="input-18" />
					<label class="input__label input__label--yoko" for="input-18">
						<span class="input__label-content input__label-content--yoko">Region</span>
					</label>
				</span>
			</section>
			<section class="content">
				<h2>Hideo</h2>
				<span class="input input--hideo">
					<input class="input__field input__field--hideo" type="text" id="input-41" />
					<label class="input__label input__label--hideo" for="input-41">
						<i class="fa fa-fw fa-user icon icon--hideo"></i>
						<span class="input__label-content input__label-content--hideo">Username</span>
					</label>
				</span>
				<span class="input input--hideo">
					<input class="input__field input__field--hideo" type="text" id="input-42" />
					<label class="input__label input__label--hideo" for="input-42">
						<i class="fa fa-fw fa-envelope icon icon--hideo"></i>
						<span class="input__label-content input__label-content--hideo">Email</span>
					</label>
				</span>
				<span class="input input--hideo">
					<input class="input__field input__field--hideo" type="text" id="input-43" />
					<label class="input__label input__label--hideo" for="input-43">
						<i class="fa fa-fw fa-lock icon icon--hideo"></i>
						<span class="input__label-content input__label-content--hideo">Password</span>
					</label>
				</span>
			</section>
			<section class="content bgcolor-3">
				<h2>Kyo</h2>
				<span class="input input--kyo">
					<input class="input__field input__field--kyo" type="text" id="input-19" />
					<label class="input__label input__label--kyo" for="input-19">
						<span class="input__label-content input__label-content--kyo">What's your email?</span>
					</label>
				</span>
			</section>
			<section class="content bgcolor-4">
				<h2>Akira</h2>
				<span class="input input--akira">
					<input class="input__field input__field--akira" type="text" id="input-22" />
					<label class="input__label input__label--akira" for="input-22">
						<span class="input__label-content input__label-content--akira">First Name</span>
					</label>
				</span>
				<span class="input input--akira">
					<input class="input__field input__field--akira" type="text" id="input-23" />
					<label class="input__label input__label--akira" for="input-23">
						<span class="input__label-content input__label-content--akira">Last Name</span>
					</label>
				</span>
				<span class="input input--akira">
					<input class="input__field input__field--akira" type="text" id="input-24" />
					<label class="input__label input__label--akira" for="input-24">
						<span class="input__label-content input__label-content--akira">Maiden Name</span>
					</label>
				</span>
			</section>
			<section class="content">
				<h2>Ichiro</h2>
				<span class="input input--ichiro">
					<input class="input__field input__field--ichiro" type="text" id="input-25" />
					<label class="input__label input__label--ichiro" for="input-25">
						<span class="input__label-content input__label-content--ichiro">Bird's Color</span>
					</label>
				</span>
				<span class="input input--ichiro">
					<input class="input__field input__field--ichiro" type="text" id="input-26" />
					<label class="input__label input__label--ichiro" for="input-26">
						<span class="input__label-content input__label-content--ichiro">Wing Span</span>
					</label>
				</span>
				<span class="input input--ichiro">
					<input class="input__field input__field--ichiro" type="text" id="input-27" />
					<label class="input__label input__label--ichiro" for="input-27">
						<span class="input__label-content input__label-content--ichiro">Beak Length</span>
					</label>
				</span>
			</section>
			<section class="content bgcolor-6">
				<h2>Juro</h2>
				<span class="input input--juro">
					<input class="input__field input__field--juro" type="text" id="input-28" />
					<label class="input__label input__label--juro" for="input-28">
						<span class="input__label-content input__label-content--juro">First Name</span>
					</label>
				</span>
				<span class="input input--juro">
					<input class="input__field input__field--juro" type="text" id="input-29" />
					<label class="input__label input__label--juro" for="input-29">
						<span class="input__label-content input__label-content--juro">Last Name</span>
					</label>
				</span>
				<span class="input input--juro">
					<input class="input__field input__field--juro" type="text" id="input-30" />
					<label class="input__label input__label--juro" for="input-30">
						<span class="input__label-content input__label-content--juro">Maiden Name</span>
					</label>
				</span>
			</section>
			<section class="content bgcolor-4">
				<h2>Madoka</h2>
				<span class="input input--madoka">
					<input class="input__field input__field--madoka" type="text" id="input-31" />
					<label class="input__label input__label--madoka" for="input-31">
						<svg class="graphic graphic--madoka" width="100%" height="100%" viewBox="0 0 404 77" preserveAspectRatio="none">
							<path d="m0,0l404,0l0,77l-404,0l0,-77z"/>
						</svg>
						<span class="input__label-content input__label-content--madoka">Frequency</span>
					</label>
				</span>
				<span class="input input--madoka">
					<input class="input__field input__field--madoka" type="text" id="input-32" />
					<label class="input__label input__label--madoka" for="input-32">
						<svg class="graphic graphic--madoka" width="100%" height="100%" viewBox="0 0 404 77" preserveAspectRatio="none">
							<path d="m0,0l404,0l0,77l-404,0l0,-77z"/>
						</svg>
						<span class="input__label-content input__label-content--madoka">Weight</span>
					</label>
				</span>
				<span class="input input--madoka">
					<input class="input__field input__field--madoka" type="text" id="input-33" />
					<label class="input__label input__label--madoka" for="input-33">
						<svg class="graphic graphic--madoka" width="100%" height="100%" viewBox="0 0 404 77" preserveAspectRatio="none">
							<path d="m0,0l404,0l0,77l-404,0l0,-77z"/>
						</svg>
						<span class="input__label-content input__label-content--madoka">Strength</span>
					</label>
				</span>
			</section>
			<section class="content">
				<h2>Kaede</h2>
				<span class="input input--kaede">
					<input class="input__field input__field--kaede" type="text" id="input-35" />
					<label class="input__label input__label--kaede" for="input-35">
						<span class="input__label-content input__label-content--kaede">First Name</span>
					</label>
				</span>
				<span class="input input--kaede">
					<input class="input__field input__field--kaede" type="text" id="input-36" />
					<label class="input__label input__label--kaede" for="input-36">
						<span class="input__label-content input__label-content--kaede">Last Name</span>
					</label>
				</span>
				<span class="input input--kaede">
					<input class="input__field input__field--kaede" type="text" id="input-37" />
					<label class="input__label input__label--kaede" for="input-37">
						<span class="input__label-content input__label-content--kaede">Website</span>
					</label>
				</span>
			</section>
			<section class="content bgcolor-8">
				<h2>Isao</h2>
				<span class="input input--isao">
					<input class="input__field input__field--isao" type="text" id="input-38" />
					<label class="input__label input__label--isao" for="input-38" data-content="First Name">
						<span class="input__label-content input__label-content--isao">First Name</span>
					</label>
				</span>
				<span class="input input--isao">
					<input class="input__field input__field--isao" type="text" id="input-39" />
					<label class="input__label input__label--isao" for="input-39" data-content="Middle Name">
						<span class="input__label-content input__label-content--isao">Middle Name</span>
					</label>
				</span>
				<span class="input input--isao">
					<input class="input__field input__field--isao" type="text" id="input-40" />
					<label class="input__label input__label--isao" for="input-40" data-content="Last Name">
						<span class="input__label-content input__label-content--isao">Last Name</span>
					</label>
				</span>
			</section>
		</div><!-- /container -->
		<script src="js/classie.js"></script>
		<script>
			(function() {
				// trim polyfill : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
				if (!String.prototype.trim) {
					(function() {
						// Make sure we trim BOM and NBSP
						var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
						String.prototype.trim = function() {
							return this.replace(rtrim, '');
						};
					})();
				}

				[].slice.call( document.querySelectorAll( 'input.input__field' ) ).forEach( function( inputEl ) {
					// in case the input is already filled..
					if( inputEl.value.trim() !== '' ) {
						classie.add( inputEl.parentNode, 'input--filled' );
					}

					// events:
					inputEl.addEventListener( 'focus', onInputFocus );
					inputEl.addEventListener( 'blur', onInputBlur );
				} );

				function onInputFocus( ev ) {
					classie.add( ev.target.parentNode, 'input--filled' );
				}

				function onInputBlur( ev ) {
					if( ev.target.value.trim() === '' ) {
						classie.remove( ev.target.parentNode, 'input--filled' );
					}
				}
			})();
		</script>
	</body>
</html>
